﻿@using Entity.ProjectEnt
@{
    ViewBag.Title = "CustomerForm";
    Layout = "~/Views/Shared/_Form.cshtml";
    CustomerAndThingsNameEntity thisobj = ViewData["objs"] as CustomerAndThingsNameEntity;
}

<script>
    var keyValue = $.request("keyValue");
    $(function () {
        if (!!keyValue) {
            $.ajax({
                url: "/Project/CustomerAndThingsName/GetFormJson",
                data: { keyValue: keyValue },
                dataType: "json",
                async: false,
                success: function (data) {
                    $("#form1").formSerialize(data);
                }
            });
        }
        else {
            $("#form1").formSerialize("add");
        }

    });

    function submitForm() {

        if (!$('#form1').formValid()) {
            return false;
        }
        $.submitForm({
            url: "/Project/CustomerAndThingsName/SubmitFormCarBoxType?keyValue=" + keyValue,
            param: $("#form1").formSerialize(),
            success: function() {
                $.currentWindow().$("#gridList").trigger("reloadGrid");
            }
        });
    }

</script>

<form id="form1">
    <div style="margin-top: 10px; margin-left: 10px; margin-right: 10px;">
        <ul class="nav nav-tabs">
            <li class="active"><a href="#">基本信息</a></li>
            @*<li ><a href="#">扩展信息</a></li>*@
        </ul>
        <div style="padding-top: 20px; margin-right: 30px;">
            <table class="form">
                <tr>
                    <th class="formTitle">名称</th>
                    <td class="formValue">
                        @{
                            if (thisobj != null)
                            {
                                @thisobj.Name
                            }
                            else
                            {
                                <input id="Name" name="Name" type="text" class="form-control required" placeholder="请输入名称" />
                            }
                        }
                    </td>
                </tr>
                <tr>
                    <th class="formTitle">备注</th>
                    <td class="formValue">
                        @{
                            if (thisobj != null)
                            {
                                @thisobj.Remark
                            }
                            else
                            {
                                <input id="Remark" name="Remark" type="text" class="form-control " placeholder="请输入备注" />
                            }
                        }
                    </td>
                </tr>
            </table>
        </div>
    </div>
</form>

